package com.linxi.handy.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @PROJECT_NAME: Handy-gitee-lx
 * @DESCRIPTION:
 * @AUTHOR: lx
 * @DATE: 2022/3/10 20:35
 */
public class ConnectionUtils {

    /**
     * 连接数据库所用的变量
     */
    public static Connection conn;

    public static Connection getConnection(String url) throws SQLException {
        conn = DriverManager.getConnection(url);
        return conn;
    }

    public static boolean isConnect() {
        return conn != null;
    }
}
